from integrations.wxauto_client import WxautoHandler

# 工具意图识别
from core.intent_handler import  IntentHandler
# 非工具deepseek
from core.chat_handler import ChatHandler

from core.message_queue import MessageQueue
from tools.log_handler import logger

class WeChatBot:
    def __init__(self,listen_list,default_role = "小李",tools = True):
        if tools:
            self.chat = IntentHandler(default_role)
        else:
            self.chat = ChatHandler()

        self.queue = MessageQueue(self.chat)
        self.wx = WxautoHandler(self.queue)
        self.listen_list = listen_list
        logger.info("WeChatBot 初始化完成")
    
    async def run(self):
        logger.info("机器人启动")
        self.queue.start()
        await self.wx.listen_and_reply_forever(listen_list=self.listen_list)